<script setup lang="ts">
import newsComp from "./component/news.vue"
import aiPortfolio from "./component/aiPortfolio.vue"
import techDiscussions from "./component/tech_discussions/index.vue"
import aiNewsComp from "./component/aiNewsComp.vue"
import axios from "axios"
import { onMounted } from "vue"
onMounted(()=>{
    // test()
})
const test = () => {
    // messages: [{"role": "user","content": "你好"}]  http://127.0.0.1:8000/v1/chat
    // axios.get(`https://ai-role.cn/echo-prod/chat?token=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMDNjZGY5ZjMtOTI2YS00YTk2LWJjNDYtMjVkM2QyOTI0ZjhmIiwiZXhwIjoxNzEyODkxNDE1fQ.RzOQ25R2tNzAys_ggzmhAP5recbXd0LYEx4x56CdfEyFgyShsGTZdo2yXYivOwC5tDfQkpeuVypDyxy3lxkX-g&cid=83367429-ce8d-4ecb-96e6-87e7bd1cdadb&prompt=hello&role=echo&xts=1712805032178&xid=0.5182333035196189&xreal=f5e43ad5821423a6d6a96202ecfcce34`,{
    axios.post(`https://foa.rockchin.top/v1/chat/completions`,{
        "messages": [
            {
                "role": "user",
                "content": "你好"
            }
        ],
        // 如果使用SSE流请设置为true，默认false
        "stream": false,
        model1:"dall-e-3",
        model: "gpt-3.5-turbo",
        prompt:"a white siamese cat",
        size:"1024x1024",
        quality:"standard",
        n:1,
        tokens: 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMDNjZGY5ZjMtOTI2YS00YTk2LWJjNDYtMjVkM2QyOTI0ZjhmIiwiZXhwIjoxNzEyODkxNDE1fQ.RzOQ25R2tNzAys_ggzmhAP5recbXd0LYEx4x56CdfEyFgyShsGTZdo2yXYivOwC5tDfQkpeuVypDyxy3lxkX-g'
        ,token: 'sk-foaDfZxzvfrwfqkBDJEMq7C0rdXkhOjXx4aM23pH42tv8SJ4'
    },{
        headers: {
            Authorization1: 'Bearer sk-foaDfZxzvfrwfqkBDJEMq7C0rdXkhOjXx4aM23pH42tv8SJ4',
            Authorization: 'Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMDNjZGY5ZjMtOTI2YS00YTk2LWJjNDYtMjVkM2QyOTI0ZjhmIiwiZXhwIjoxNzEyODkxNDE1fQ.RzOQ25R2tNzAys_ggzmhAP5recbXd0LYEx4x56CdfEyFgyShsGTZdo2yXYivOwC5tDfQkpeuVypDyxy3lxkX-g'
        }
    }).then((res) => {
        console.log(res,'res ======== ')
    })
}

</script>

<template>
    <div class="index_box">
        <div class="news_comp">
            <newsComp/>
        </div>
        <div class="aiPro_comp">
            <techDiscussions/>
        </div>
        <div class="aiPro_comp">
            <aiPortfolio/>
        </div>
        <div class="aiNews_comp">
            <aiNewsComp/>
        </div>
    </div>
</template>

<style scoped lang="scss">
.index_box{
    width: 100vw;
    min-width: 1100px;
    height: calc(100vh - 185px);
    overflow: hidden;
    overflow-x: auto;
    padding: 11px 10px 0 10px;
    background: #eee;
    display: flex;
    .news_comp{
        width: 25%;
        max-width: 320px;
    }
    .news_comp,
    .aiPro_comp,
    .aiNews_comp{
        height: 98%;
        overflow: auto;
        // border: 1px solid #eee;
        background: #fff;
        border-radius: 6px;
        padding: 8px;
        display: inline-block;
    }
    .aiNews_comp{
        width: 25%;
        max-width: 400px;
    }
    .aiPro_comp{
        width: 25%;
        margin: 0 8px;
        overflow: hidden;
    }
}
</style>
